// text-color
@each $colorKey,
$color in $colors {
    .text-#{$colorKey} {
        color: $color;
    }
}

@each $direction in (left, center, right) {
    .text-#{$direction} {
        text-align: $direction !important;
    }
}

// border-color
@each $colorKey,
$color in $colors {

    // border-primary
    .border-#{$colorKey} {
        border: 1px solid $color;
    }

    // border-left-primary
    @each $direction in (left, top, right, bottom) {
        .border-#{$direction}-#{$colorKey} {
            border-#{$direction}: 1px solid $color;
        }
    }

}

// background-color
@each $colorKey,
$color in $colors {
    .bg-#{$colorKey} {
        background-color: $color;
    }

    .bg-#{$colorKey}-hover {
        background: mix(#000, $color, 0.5);
    }
}

// font-size
@each $sizeKey,
$size in $font-sizes {
    .fs-#{$sizeKey} {
        font-size: $size * $base-font-size;
    }
}


// felx-layout
.d-flex {
    display: flex;
}
.d-inline-block{
    display: inline-block
}

.flex-wrap {
    flex-wrap: wrap;
}
.flex-shrink{
    flex-shrink: 0;
}

.a-self-end{
    align-self: flex-end;
}
.a-self-start{
    align-self: flex-start;
}
// flex-direction
@each $directionKey,
$direction in $flex-directions {
    .flex-#{$directionKey} {
        flex-direction: $direction;
    }
}

// flex-grid-12
@each $key,
$value in $flex-grid-12 {
    .flex-#{$key} {
        flex: $value;
    }

    .flex-grow-#{key} {
        flex-grow: $value;
    }

    .flex-shrink-#{key} {
        flex-shrink: $value;
    }
}

// justify-content
@each $directionKey,
$direction in $flex-jc {
    .jc-#{$directionKey} {
        justify-content: $direction;
    }
}

// align-items
@each $directionKey,
$direction in $flex-ai {
    .ai-#{$directionKey} {
        align-items: $direction;
    }
}

// spacing margin padding
@each $typeKey,
$type in $spacing-types {

    // m-0 p-0
    @each $sizeKey,
    $size in $spacing-sizes {
        .#{$typeKey}-#{$sizeKey} {
            #{$type}: $size * $base-spacing-size !important;
        }
    }

    @each $sizeKey,
    $size in $spacing-sizes {
        .#{$typeKey}x-#{$sizeKey} {
            #{$type}-left : $size * $base-spacing-size;
            #{$type}-right: $size * $base-spacing-size;
        }

        .#{$typeKey}y-#{$sizeKey} {
            #{$type}-top   : $size * $base-spacing-size;
            #{$type}-bottom: $size * $base-spacing-size;
        }
    }

    // m-t1 pt-1
    @each $directionKey,
    $direction in $spacing-directions {

        @each $sizeKey,
        $size in $spacing-sizes {
            .#{$typeKey}#{$directionKey}-#{$sizeKey} {
                #{$type}-#{$direction}: $size * $base-spacing-size;
            }
        }
    }
}

// width
.w-100 {
    width: 100%;
}

// height
.h-100 {
    height: 100%;
}

// button
.btn {
    border       : none;
    border-radius: 0.1538rem;
    font-size    : map-get($font-sizes, 'sm') * $base-font-size;
    padding      : 0.2rem 0.6rem;

    &.btn-lg {
        display        : flex;
        justify-content: center;
        align-items    : center;

        i {
            color       : map-get($colors, 'primary');
            font-weight : bold;
            font-size   : 1.5rem;
            margin-right: 0.5rem;
        }

        background: map-get($colors, 'white-1');
        border    : 1px solid map-get($colors, 'white-2');
        padding   : 0.8rem 1rem;
        font-size : 1rem;
    }
}

// nav
.nav {
    display: flex;

    .nav-item {
        border-bottom : 3px solid transparent;
        padding-bottom: 0.2rem;

        &.active {
            color              : map-get($colors, 'primary');
            border-bottom-color: map-get($colors, 'primary');
        }
    }

    &.nav-inverse {
        .nav-item {
            color: map-get($colors, 'white');

            &.active {
                border-bottom-color: map-get($colors, 'white');
            }
        }
    }

}

// sprite
.sprite {
    background     : url(../images/index.png) no-repeat 0 0;
    background-size: 28.8462rem;
    display        : inline-block;

    &.sprite-news {
        width              : 1.7692rem;
        height             : 1.5385rem;
        background-position: 63.546% 15.517%;
    }

    &.sprite-arrow {
        width              : 0.7692rem;
        height             : 0.7692rem;
        background-position: 38.577% 52.076%;
    }
}

// borders
@each $dir in (top, right, bottom, left) {
    .border-#{$dir} {
        border-#{$dir}: 1px solid $border-color;
    }
}

.text-ellipsis {
    overflow     : hidden;
    white-space  : nowrap;
    text-overflow: ellipsis;
}

.fs-weight {
    font-weight: bold;
}

// position
@each $typeKey,
$type in $position-types {
    .position-#{$typeKey} {
        position: $type;
    }
}
@each $dirKey, $dir in $position-directions {
    .#{$dirKey}-0{
        #{$dir}: 0;
    }
}

// border
.border{
    border: 1px solid #000000;
}
.boder-secondary{
    border-color: #cccccc;
}
.boder-light-secondary{
    border-color: #eceef0;
}
.border-radius{
    border-radius: 100%;
}
.border-rounded{
    border-radius: 0.3077rem;
}

// line
.line{
    line-height: 1.4;
}
.line-1{
    line-height: 1;
}
.line-sm{
    line-height: 1.2;
}
.line-md{
    line-height: 1.5;
}
